package com.tj.jinzao.activity;

import android.content.Intent;
import android.support.v4.app.Fragment;
import android.util.Log;

import com.luck.picture.lib.PictureSelector;
import com.luck.picture.lib.config.PictureConfig;
import com.luck.picture.lib.entity.LocalMedia;
import com.tj.jinzao.R;
import com.tj.jinzao.base.BaseActivity;
import com.tj.jinzao.fragment.ChooseOccupationFragment;

import java.util.List;

/**
 * 我的身份认证界面
 * Created by wjy on 2019/1/5.
 */
public class ChooseOccupationActivity extends BaseActivity {


    @Override
    public int getLayoutResource() {
        return R.layout.base_activity_fragment_layout;
    }

    @Override
    protected int getLeftButtonResId() {
        return R.mipmap.ic_back;
    }


//    @Override
//    protected void clickRightButton() {
//        PictureSelector.create(this)
//                .openGallery(PictureMimeType.ofVideo())
//                .forResult(PictureConfig.CHOOSE_REQUEST);
//    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (resultCode == RESULT_OK) {
            switch (requestCode) {
                case PictureConfig.CHOOSE_REQUEST:
                    // 图片、视频、音频选择结果回调
                    List<LocalMedia> selectList = PictureSelector.obtainMultipleResult(data);
                    // 例如 LocalMedia 里面返回三种path
                    // 1.media.getPath(); 为原图path
                    // 2.media.getCutPath();为裁剪后path，需判断media.isCut();是否为true  注意：音视频除外
                    // 3.media.getCompressPath();为压缩后path，需判断media.isCompressed();是否为true  注意：音视频除外
                    // 如果裁剪并压缩了，以取压缩路径为准，因为是先裁剪后压缩的
                    Log.i("wjy","test");
                    break;
            }
        }
    }

    @Override
    protected Fragment createFragment() {
        return ChooseOccupationFragment.newInstance();
    }
}
